package com.ghck.shop.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import com.ghck.shop.dao.provider.FlowWaterMapperProvider;
import com.ghck.shop.model.FlowWater;

public interface FlowWaterMapper {

	@Insert("insert into t_flow_water"
			+ "(user_id,pic,amount,`describe`,type,create_time,update_time)"
			+ "values"
			+ "(#{userId},#{pic},#{amount},#{describe},#{type},now(),now())")
	public Integer saveFlowWater(FlowWater flowWater);
	
	@SelectProvider(type=FlowWaterMapperProvider.class,method="listFlowWaters")
	public List<FlowWater> listFlowWaters(FlowWater flowWater);
	
	@Select("select sum(amount) amount from t_flow_water where user_id=#{userId}")
	public Integer myMoney(Integer userId);
}
